{include file="public/header"}

<body>
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post">
        <div class="ch-row ch-info-form">
            <div class="flex1">店长列表：</div>
            <div class="flex2">{$data.username}</div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">业绩：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.content}" name="content" >
                <input  value="{$data.created_time}" name="created_time" type="hidden">
                <input  value="{$data.user_id}" name="user_id" type="hidden">
                <input  value="{$data.achievement_id}" name="achievement_id" type="hidden">
            </div>
        </div>
        <br>
        <div class="ch-row">
            <div class="flex1">
                <button class="btn btn-primary radius" style="width: 100%;" type="button"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
            </div>
        </div>
    </form>
</div>

{include file="public/footer"}
<script>
    $('.radius').click(function () {
        var src="{:Url('index/achievement/edit')}";
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        $.ajax({
            type: 'POST',
            url: src,
            dataType: 'json',
            data:$('form').serializeArray(),
            success: function (data) {
                var res=JSON.parse(data);
                if(res.code==200){
                    layer.closeAll();
                    layer.msg(res.msg, {icon: 1, time: 2000}, function () {
                        setTimeout("window.parent.location.reload()", 1);
                    });
                }else{
                    layer.msg(res.msg,{icon: 5,time:1000});
                }

            },
            error: function (data) {
                console.log(data.msg);
            },
        })
    });
</script>
</body>
</html>